local GameWorld = {}

function GameWorld:new()
   local gameWorld =  display.newGroup()

   --Logical attributes
   gameWorld.activeTimers = {}
   gameWorld.time = 0--milliseconds

   --Game Groups
   gameWorld.background = display.newImage(gameWorld,'resources/sprites/bg.jpg')
      gameWorld.background.width,gameWorld.background.height = X,Y
      gameWorld.background.x,gameWorld.background.y = halfX,halfY
   gameWorld.grid = Grid:new(8,8,2)
   gameWorld.player = Player:new(halfX,halfY,gameWorld.grid)

   gameWorld:insert(gameWorld.background)
   gameWorld:insert(gameWorld.grid)
   gameWorld:insert(gameWorld.player)

   function gameWorld:update(delta)
      self.time = self.time + delta

      self.grid:update(delta)
      self.player:update(delta)
   end

   return gameWorld
end

return GameWorld